<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改课程套餐')" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-meal-edit" th:object="${eduCourseMeal}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">所属课程：</label>
                <div class="col-sm-8">
                    <input name="courseName" th:field="*{courseId}" class="form-control" disabled type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">套餐名称：</label>
                <div class="col-sm-8">
                    <input name="mealName" th:field="*{mealName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">课时：</label>
                <div class="col-sm-8">
                    <input name="courseHourse" th:field="*{courseHourse}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">赠送课时：</label>
                <div class="col-sm-8">
                    <input name="giveCourseHours" th:field="*{giveCourseHours}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">原价：</label>
                <div class="col-sm-8">
                    <input name="originalPrice" th:field="*{originalPrice}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠方式：</label>
                <div class="col-sm-8">
                    <select name="discountType" class="form-control m-b" th:with="type=${@dict.getType('discount_type')}" th:field="*{discountType}" th:switch="*{discountType}">
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:case="${dict.dictValue}" th:selected="selected"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠值：</label>
                <div class="col-sm-8">
                    <input name="discountValue" th:field="*{discountValue}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="remark" th:field="*{remark}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "edu/meal";
        $("#form-meal-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-meal-edit').serialize());
            }
        }
    </script>
</body>
</html>